import { useState } from 'react'

function Item(props) {
  const [name, setName] = useState('name')
  return <div onClick={() => setName('点击了')}>
    item: {name}
    <div onClick={props.onItemClick ? () => props.onItemClick(name) : undefined}>子元素</div>
  </div>
}

export default Item